<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.section1>p:nth-child(3) {
				background-color: #f00;
			}
			
			.section2>p:nth-of-type(3) {
				background-color: #f00;
			}
		</style>
	</head>
	<body>
		<h2>nth-child(3)</h2>
		<section class="section1">
			<p>1</p>
			<div>2-div</div>
			<p>3</p>
			<p>4</p>
			<p>5</p>
		</section>
		<h2>nth-of-type(3)</h2>
		<section class="section2">
			<p>1</p>
			<div>2-div</div>
			<p>3</p>
			<p>4</p>
			<p>5</p>
		</section>
	</body>
</html>